package com.tarry;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * spring event 设计思想使用的是监听者模式
 */
public class EventTest {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(EventConfig.class);
        MyPublisher publisher = context.getBean(MyPublisher.class);
        publisher.publish("you have my wrods");
        context.close();
    }
}